USE [Forums]
GO

/****** Object:  StoredProcedure [dbo].[SPQuestionUpdate]    Script Date: 08/09/2012 11:47:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[SPQuestionUpdate]
	@q_ID int
	,@title nvarchar(150)
	,@description nvarchar(500)
	,@forumID int
	
AS
BEGIN TRY
	BEGIN TRANSACTION
	
	update ASK_Question
set
	title = @title,
	description = @description,
	forumID = @forumID
WHERE
	q_ID = @q_ID
	
	COMMIT

END TRY
BEGIN CATCH
	IF @@TRANCOUNT > 0
		ROLLBACK

  -- Raise an error with the details of the exception
	DECLARE @ErrMsg nvarchar(4000), @ErrSeverity int
	SELECT @ErrMsg = ERROR_MESSAGE(),
		 @ErrSeverity = ERROR_SEVERITY()

	RAISERROR(@ErrMsg, @ErrSeverity, 1)

END CATCH

GO


